package com.yanqu.road.server.cmd.tradewar;

import com.yanqu.road.pb.cross.tradewar.CrossTradeWarProto;
import com.yanqu.road.pb.tradewaractivity.TradeWarActivityProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_TRADE_WAR_MEMBER_CONDITION_DATA, desc = "跨服查询跨服商战成员贡献信息")
public class CrossTradeWarMemberConditionDataCmd extends CrossCommand {
    private long userId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        TradeWarActivityProto.TradeWarActivityConditionUnionMemberDataReqMsg reqMsg = TradeWarActivityProto.TradeWarActivityConditionUnionMemberDataReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        CrossTradeWarProto.CrossTradeWarConditionUnionMemberDataReqMsg.Builder msg = CrossTradeWarProto.CrossTradeWarConditionUnionMemberDataReqMsg.newBuilder();
        msg.setUserId(userId);
        msg.setServerId(serverId);
        msg.setActivityId(reqMsg.getActivityId());
        msg.setUnionUid(reqMsg.getUnionUid());
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.S_CROSS_TRADE_WAR_CROSS_QUERY_MEMBER_CONDITION, msg);
        MessageHelper.sendPacket(reqMsg.getServerId(), 0, pbMsg);
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

    }

    @Override
    public void sendData() {

    }
}
